package com.senven.order.config;

import org.springframework.stereotype.Component;

import java.util.UUID;

/**
 * @Author wt
 * @Date 2022/9/7 10:20
 * @PackageName:com.senven.order.config
 * @ClassName: OrderRandom
 * @Description: 随机生成一个16位的纯数字订单编号
 * @Version 1.0
 */
@Component
public class OrderRandom {

    public String sss(){
        int v = (int) (Math.random() * 9 + 1);
        String s1 = String.valueOf(v);
        int s = UUID.randomUUID().toString().hashCode();
        if (s<0){
            s = -s;
        }
        String replace = s1+String.format("%015d",s);
        System.out.println(replace);
        return replace;

    }
}
